import {
    request
} from "./request";
import qs from "qs";

//  添加商品
export function addProduct(obj) {
    return request({
        url: "scProduct/addProduct",
        method: "post",
        data: obj,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}
//  获取商品列表
export function getProductListByCompanyId(obj) {
    return request({
        url: "scProduct/getProductListByCompanyId",
        method: "post",
        data: qs.stringify(obj),
    });
}
// 根据  id 获取商品统计
export function getProductCountInfo(obj) {
    return request({
        url: "scProduct/getProductCountInfo",
        method: "post",
        data: qs.stringify(obj),
    });
}
// 根据  id 获取商品详情
export function getProductById(obj) {
    return request({
        url: "scProduct/getProductById",
        method: "post",
        data: qs.stringify(obj),
    });
}
// 商品 上架  下架
export function offProduct(obj) {
    return request({
        url: "scProduct/offProduct",
        method: "post",
        data: qs.stringify(obj),
    });
}
// 根据id 删除商品图片
export function deleteImage(obj) {
    return request({
        url: "scProduct/deleteImage",
        method: "post",
        data: qs.stringify(obj),
    });
}
// 获取所有商品  不分页
export function getAllProductList(obj) {
    return request({
        url: "scProduct/getProductListByCompanyIdNoPage",
        method: "post",
        data: qs.stringify(obj),
    });
}
// 新增商品图片
export function addImage(obj) {
    return request({
        url: "scProduct/addImage",
        method: "post",
        data: obj,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}
// 修改商品信息
export function updateProduct(obj) {
    return request({
        url: "scProduct/updateProduct",
        method: "post",
        data: obj,
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}